package com.tlxch.mapper;

import com.github.pagehelper.Page;
import com.tlxch.dto.*;
import com.tlxch.pojo.SStudent;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface SStudentMapper {
    int deleteByPrimaryKey(Integer sId);

    int insert(SStudent record);

    int insertSelective(SStudent record);

    SStudent selectByPrimaryKey(Integer sId);

    int updateByPrimaryKeySelective(SStudent record);

    int updateByPrimaryKey(SStudent record);

    void addstu(List<TStudentdto> tStudentdtoList);

    @Select("SELECT DISTINCT s_grade FROM s_student")
    List<String> getGrade();

    @Select("SELECT DISTINCT s_specialized FROM s_student")
    List<String> getSpecialty();

    Page<SStudent> pageQuery(TStudto tStudto);

    SStudent findbysid(String getsSid);

    void updateInfo(SStudentdto studentdto);

    void updateStu(SStudent student);

    void updateStuPassword(SupdatePwddto student);

    @Select("select s_sid from s_student where s_grade = #{grade} " +
            "and s_specialized=#{major} and s_class = #{scClass}")
    List<String> getStuId(String major,Integer grade,Integer scClass);
}